<?php

namespace app\openapi\validator;

use think\Validate;

class CreateOrderValidator extends Validate
{
    protected $rule = [
        'account' => 'require|length:4,120',
        'goods_name' => 'require',
        'goods_price' => 'require|float|gt:0',
        'goods_amount' => 'require|integer|egt:1',
        'payment_type' => 'require|in:1',
    ];
    protected $message = [
        'account.require' => 'TG账号不能为空',
        'account.length' => 'TG账号长度必须在4-120位',
        'goods_name.require' => '商品名称不能为空',
        'goods_price.require' => '商品价格不能为空',
        'goods_price.float' => '商品价格必须是浮点类型',
        'goods_price.gt' => '商品价格必须大于零',
        'goods_amount.require' => '商品数量不能为空',
        'goods_amount.integer' => '商品数量必须是整数',
        'goods_amount.egt' => '商品数量必须大于零',
        'payment_type.require' => '支付方式不能为空',
        'payment_type.in' => '支付方式必须在1内',
    ];
}